
package database;

import java.awt.Desktop;
import java.io.File;
import java.io.IOException;

public class PDFHandler {

    public static void open(File file) {
        try {
            if (file.exists()) {
                if (Desktop.isDesktopSupported()) {
                    Desktop.getDesktop().open(file);
                } else {
                    javax.swing.JOptionPane.showMessageDialog(null, "Awt Desktop is not supported, this function cannot be used", "Awt Error", javax.swing.JOptionPane.ERROR_MESSAGE, null);
                }
            } else {
            }
        } catch (IOException e) {
            javax.swing.JOptionPane.showMessageDialog(null, "An Error Occured with input output file handling", "Error", javax.swing.JOptionPane.ERROR_MESSAGE, null);
        }
    }
}
